#include "apue.h"
#include <fcntl.h>

char buf1[] = "asdfghjkl*";
char buf2[] = "ASDFGHJKL*";

int main(void){
    int fd = 1;
    
    if ((fd = open("file.nohole", O_RDWR | O_CREAT)) < 0){
        err_sys("create error");
    }

    printf("fd=%d", fd);

    if (write(fd, buf1, 10) != 10){
        err_sys("buf1 write error");
    }

    if (lseek(fd, 16384, SEEK_SET) == -1){
       err_sys("lseek error");
    }

    if (write(fd, buf2, 10) != 10){
        err_sys("wriete buf2 error");
    }

    exit(0);
}